void PrevOrder(struct TreeNode* root,int*res,int*r)
{
	if (root == NULL)
	{
		return;
	}
	res[(*r)++]=root->val;
	PrevOrder(root->left,res,r);
	PrevOrder(root->right,res,r);
}
int* preorderTraversal(struct TreeNode* root, int* returnSize)
{
    int* res=(int*)malloc(sizeof(int)*100);
    *returnSize=0;
    PrevOrder(root,res,returnSize);
    return res;
}